perm filename INTOPS.PAL[HAL,HE]14 blob
sn#198351 filedate 1976-01-27 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00002 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 .SBTTL Table of interpreter instructions
C00011 ENDMK
C⊗;
.SBTTL Table of interpreter instructions
COMMENT ⊗
This table is parallel to the file INTDEF.SAI[HAL,HE]. It is required
at several places in the interpreter; each of these can define the
macro MAKEOP however desired. The convention here for types of
arguments that each pseudo-op takes is this:
a absolute address
la list of absolute addresses
o offset or level-offset pair
lo list of offsets or level-offset pairs
n small constant
r50 word of radix 50
⊗
II == 2 ;Start of interpreter jump table (0 is illegal instruction)
;Motion control
MAKEOP XMOVE,MOVE,<a> ;Prepare, execute move whose traj table is at a.
MAKEOP XCENTER,CENTER,<a>, ;Center using traj table at a.
MAKEOP XSTOP,STOP,<n> ;Cause all mechanisms whose bits are on in n to stop.
;Variables
MAKEOP XMVAR,MVAR,<lo> ;Make graph node for given offsets (list arg)
MAKEOP XKVAR,KVAR,<lo> ;Kill graph node at given offsets (list arg)
MAKEOP XGLBLNK,GLBLNK,<lo,r50,r50>
;Link global given by r50,r50 into level-offset lo.
MAKEOP XMAKEVT,MAKEVT,<lo> ;Make event variables with offsets as in list.
MAKEOP XDESEVT,DESEVT,<lo> ;Kill event variables with offsets as in list.
MAKEOP XMEXP,MEXP,<lo,a,o> ;Make an expression whose needed list is lo
; at address a, and call it offset o.
MAKEOP XMCLC,MCLC,<o,o>;Make the expression at level-offset o1 a calculator
; for the variable at o2.
MAKEOP XDCLC,DCLC,<o,o>;Unmake the expression at level-offset o1 a calculator
; for the variable at o2.
MAKEOP XMCHG,MCHG,<o,a>;Make a changer for variable at level-offset o at address a.
MAKEOP XGTOLD,GTOLD ;Get the old value for current changer.
MAKEOP XGTNEW,GTNEW ;Get the new value for current changer.
;Stack operations
MAKEOP XGTVAL,GTVAL,<o>;Push value of arg (level-offset pair).
MAKEOP XIGTVAL,IGTVAL,<a> ;Push arg (immediate).
MAKEOP XCHNGE,CHNGE,<o>;Pop value into arg (level-offset pair).
MAKEOP XICHNGE,ICHNGE,<a>;Pop value into arg (immediate).
MAKEOP XPUSH, PUSH,<a> ;Push arg directly (as a ptr) onto stack. For cnstnts.
MAKEOP XPOP, POP ;Pop stack.
MAKEOP XCOPY, COPY ,<n>;Copy n'th down to top of stack.
MAKEOP XREPLAC,REPLAC,<n> ;Replace n'th down with top (which pop)
MAKEOP XFLUSH,FLUSH ;Flush the entire stack.
;Flow of control
MAKEOP XJUMP, JUMP, <a>;Jump to address
MAKEOP XJUMPC,JUMPC,<n,a> ;Jump to address only if condition "n" on top
MAKEOP XTERMINATE,TERMINATE ;Terminate this interpreter
MAKEOP XENDCLC,ENDCLC ;Return from calculator cell
MAKEOP XPROC, PROC,<a,lo> ;Call a procedure at a, with arg list lo
MAKEOP XRETURN,RETURN ;Return from procedure
MAKEOP XSPROUT,SPROUT;la ;Sprout interpreters at each arg, wait (list arg)
MAKEOP XFORCHK,FORCHK,<a> ;Do a FOR-loop check, and fail to location d.
MAKEOP XSIGNAL,SIGNAL,<o> ;Signal event at level-offset o.
MAKEOP XWAITE,WAITE,<o> ;Wait on event at level-offset o.
;Arithmetic
MAKEOP XWHERE,WHERE,<n> ;Push the current location of mechanism n
MAKEOP XSADD, SADD ;S+S: Add top two elts, pop, pop, push answer
MAKEOP XSSUB, SSUB ;S-S: Sub top two elts, pop, pop, push answer
MAKEOP XSNEG, SNEG ;-S: Negate top elt, pop, push answer
MAKEOP XSMUL, SMUL ;S*S: Mul top two elts, pop, pop, push answer
MAKEOP XSDIV, SDIV ;S/S: Div top two elts, pop, pop, push answer
MAKEOP XVMAGN, VMAGN ;S ← norm of vector
MAKEOP XVDOT, VDOT ;S ← vector dot vector
MAKEOP XPVDOT,PVDOT ;S ← vector dot vector all 4 cells
MAKEOP XSSBRTN,SSBRTN,<n> ;S ← SBRTN[n](top scalar elt)
MAKEOP XVMAKE,VMAKE ;V ← vector(scalar,scalar,scalar)
MAKEOP XSVMUL,SVMUL ;V ← scalar * vector
MAKEOP XVADD, VADD ;V ← vector + vector
;UNITV remove ;Vector ← vector / its norm
;CROSV remove ;Vector ← vector cross vector
MAKEOP XTVMUL,TVMUL ;Vector ← trans * vector
;AXWR ;T ← rotation(v,v)
MAKEOP XTMAKE,TMAKE ;T ← trans(rot,vector)
MAKEOP XTVADD,TVADD ;T ← t + v
;FTOF
MAKEOP XTTMUL,TTMUL ;T ← trans * trans
MAKEOP XTINVRT,TINVRT ;T ← trans * trans
;Condition monitors
MAKEOP XCMMAK,CMMAK,<o>;Make a c-m at offset o
MAKEOP XCMENBL,CMENBL,<o> ;Enable c-m at level-offset o
MAKEOP XCMDSBL,CMDSBL,<o> ;Disable c-m at level-offset o
MAKEOP XCMDEST,CMDEST,<lo> ;Destroy c-m at offset lo (list arg)
MAKEOP XCMTRIG,CMTRIG ;Trigger the c-m body (use only in checker)
MAKEOP XCMSKED,CMSKED,<n> ;Sleep for n mills (use only in checker)
MAKEOP XCMUNCR,CMUNCR ;Start uncritical section
;Force control
MAKEOP XGETFORCE,GETFORCE,<o> ;Push current force via FMBLK in <o>
MAKEOP XMAKFORCE,MAKFORCE,<o,n>;Make FMBLK in offset <o> for mechanism n
MAKEOP XDESFORCE,DESFORCE,<o> ;Destroy FMBLK in level-offset <o>
;Initialization
MAKEOP XPROG,PROG ;Initialize mechanism variables
;Debugging aids
MAKEOP XPRINT,PRINT ;Type an ASCIZ string on the VT05.
MAKEOP XVALPRN,VALPRN ;Type a value, whatever type it is, and pop it.
MAKEOP XVARPRN,VARPRN,<o> ;Type a variable (level-offset), whatever type.
MAKEOP XBRACE,NOOP ;Bracepoint in the program (break or trace)
MAKEOP XNOOP,NOOP ;Null operation
MAKEOP XTOPAL,TOPAL ;Escape to PAL